﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.MODEL.FoundationModel;
using MINERP.DAL.Statistics;
using System.Data;

namespace MINERP.BLL.Statistics
{
    //
    public class UserDesignerStatBLL
    {
        public List<Tb_WorkerGroup_Info> GetGroupList()
        {
            return UserDesignerStatDAL.GetAllGroup();
        }

        /// <summary>
        /// -1代码参数不对
        /// </summary>
        /// <param name="groupId"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="ds"></param>
        /// <returns></returns>
        public int GetDesignerStat(int groupId, DateTime startTime, DateTime endTime, out DataSet ds)
        {
            int result = 0;
            ds = null;
            if (groupId <= 0)
            {
                result = -1;
            }
            else
            {
                if (startTime >= endTime)
                {
                    result = -1;
                }
                else
                {
                    ds = UserDesignerStatDAL.GetStat(groupId, startTime, endTime);
                    if (ds != null)
                    {
                        result = 1;
                    }
                }
            }
            return result;
        }
    }
}
